package com.foodplus.www.presenter;

import com.foodplus.www.api.BaseSubscriber;
import com.foodplus.www.api.ExceptionHandle;
import com.foodplus.www.bean.shop.ShopTagBean;
import com.foodplus.www.model.impl.ShopModelImpl;
import com.foodplus.www.view.impl.ShopTagView;

import java.util.Map;

/**
 * Created by WangZhiChao on 2016/11/2.
 */

public class ShopTagPresenter {
    ShopTagView view;

    public ShopTagPresenter(ShopTagView view) {
        this.view = view;
    }

    public void getShopTagData(Map<String, String> params) {

        new ShopModelImpl().getShopTagData(new BaseSubscriber<ShopTagBean>() {

            @Override
            public void onSuccess(ShopTagBean shopTagBean) {
                view.onSuccess(shopTagBean);
            }

            @Override
            public void onFail(ExceptionHandle.ResponeThrowable e) {
                view.onFail(e);
            }

            @Override
            public void onFinished() {
                view.onFinish();
            }
        }, params);

    }
}
